package com.card323.crpg.skill;

import java.util.ArrayList;

import com.card323.crpg.Hero;
import com.card323.crpg.battle.ActionPoint;
import com.card323.crpg.effect.Effect;

public class Skill {

	public String _name;
	protected ArrayList<Effect> _effects=new ArrayList<Effect>();
	protected ActionPoint _active_ap_cost=new ActionPoint();
	boolean _is_need_target=false;
	protected String _info;
	public Skill()
	{
		_info="";
		_name="";
	}

	public void active(Hero owner,ArrayList<Hero> targets)
	{
		owner.get_bi().get_ap().minus_action_point(_active_ap_cost);
		owner.get_bi().send_message_to_all(owner.get_name()+"施放了"+_name);
		for(Hero hero :targets)
		{
			for(Effect effect : _effects)
			{
				effect.affect(hero);
			}
		}
	}
	public void add_effect(Effect active_effect) {
		_effects.add(active_effect);
		
	}
	public void set_ap_cost(ActionPoint ap) {
		_active_ap_cost.set_action_point(ap);
		
	}
	public void set_name(String string) {
		_name=string;
	}
	public ActionPoint get_active_ap_cost() {
		
		return _active_ap_cost;
	}
	public boolean is_need_target() {
		
		return _is_need_target;
	}
	public String get_info() {
		return _info;
	}
	public void set_info(String string) {
		_info=string;
	}

}
